home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / r / rexx_plus_compiler / rexxpluscompiler2.dms / in.adf / Examples / examples.zoo / err.txed < prev    next >
Encoding:
Text File  |  1991-11-01  |  1.5 KB  |  79 lines

  1. /* err:                     */
  2. /*       is used to locate the errors within    */
  3. /*       the c source from the aztecc.err file. */
  4. trace o
  5.    parse arg pfk line
  6.  
  7.    options results
  8.    'status d'
  9.    fms = result
  10.    if fms ~= ''  & right(fms,1) ~= ':'
  11.    then fms = fms'/'
  12.    'status f'
  13.    fns = upper(result)
  14.    fils = fms''fns
  15.    if pos('.A68',fils) ~= 0
  16.    then asm = 1
  17.    else asm = 0
  18.  
  19.    'cmd 0'
  20.    'cmd 1'
  21.    'window 0,0,640,170'
  22.  
  23.    if pfk  =  '' then pfk = 6
  24.    if line = '' then line = 1
  25.  
  26.    if open('file1','AztecC.err','read') = 0
  27.    then do
  28.      'macro' pfk 'err' pfk 1
  29.      'msg No error message file found'
  30.      exit 
  31.      end
  32.  
  33.    do i = 1 to line
  34.       string = readln('file1')
  35.       end
  36.  
  37.    if eof('file1') 
  38.    then do
  39.      'macro' pfk 'err' pfk 1
  40.      'msg No more error messages'
  41.      exit 
  42.      end
  43.  
  44. if asm
  45. then do
  46.    parse value string with 'File "'fn'"'.'Line'ln lit errnum':'errmsg
  47.    fm = ''
  48.    end
  49. else do
  50.    parse value string with fn':'ln':'col':'errnum':'errmsg':'lit
  51.    if (datatype(ln,'n') = 0)
  52.    then do
  53.     parse value string with fm':'fn':'ln':'col':'errnum':'errmsg':'lit
  54.     if fm ~= ''
  55.     then fn = fm':'fn
  56.     end
  57.    end
  58.  
  59.    fn = reverse(fn)
  60.    parse upper value fn with fn'/'fm
  61.    if fm ~= '' then fm = '/'fm
  62.    parse value fn with fn':'fm2
  63.    fn = reverse(fn)
  64.    fm2 = reverse(fm2)
  65.    fm = reverse(fm)
  66.    if fm ~= '' & fm2 ~= ''
  67.    then fm = fm2':'fm
  68.  
  69.    if fns ~= fn
  70.    then do
  71.      'SAVEAS'
  72.      'LOAD' fm||fn
  73.      end
  74.    'JU' ln col
  75.    line = line + 1
  76.    close('file1')
  77.    'macro' pfk 'err' pfk line
  78.    'MSG "'LIT'" ='errnum'='errmsg
  79.